package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Menu;
import com.wiscamp.ninechapters.panels.infrastructure.po.MenuPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.MenuView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface MenuConverter {
    MenuConverter Instance = Mappers.getMapper(MenuConverter.class);

    Menu toMenu(MenuPO po);

    Menu toMenuByView(MenuView view);

    MenuPO toMenuPO(Menu entity);

    MenuPO toMenuPO(Menu entity, @MappingTarget MenuPO po);

}
